Repository navigation
Publish a wasmJs target so the library works on the web - #321
Merged
Merged
Conversation
The library needed no wasm-specific source. jvmMain and iosMain are empty directories and androidMain holds only a manifest, so everything already lives in commonMain, and every dependency — Compose ui/foundation/material3, coroutines, collections-immutable — publishes wasm-js variants. One test blocked it. HueFractionMappingTest used kotlin.math.nextDown, which wasmJs does not provide; the production code had already hit this and works around it via the bit pattern, with a comment saying so. The test now computes the value itself rather than reusing the implementation's constant, which would have made the assertion circular. binaries.executable() is required even for a library: without it webpack does not bundle the Skiko runtime and the browser test target cannot load Compose. See CMP-4906. The klib API dump gains wasmJs, and releases now produce six publications instead of five. Verified: 329 commonTest tests execute in a real browser under wasmJsBrowserTest with zero failures, alongside 332 on JVM and 329 on the Android host. The conversion maths is now checked on a third platform rather than assumed to port.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The library needed no wasm-specific source. jvmMain and iosMain are empty directories and androidMain holds only a manifest, so everything already lives in commonMain, and every dependency — Compose ui/foundation/material3, coroutines, collections-immutable — publishes wasm-js variants.
One test blocked it. HueFractionMappingTest used kotlin.math.nextDown, which wasmJs does not provide; the production code had already hit this and works around it via the bit pattern, with a comment saying so. The test now computes the value itself rather than reusing the implementation's constant, which would have made the assertion circular.
binaries.executable() is required even for a library: without it webpack does not bundle the Skiko runtime and the browser test target cannot load Compose. See CMP-4906.
The klib API dump gains wasmJs, and releases now produce six publications instead of five.
Verified: 329 commonTest tests execute in a real browser under wasmJsBrowserTest with zero failures, alongside 332 on JVM and 329 on the Android host. The conversion maths is now checked on a third platform rather than assumed to port.